package Pisum;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
import java.util.Set;

/**
 * Created by wangyg 
 * on 2017/9/13 17:09
 */
public class Test {
	public static void main(String[] args) throws IOException {
		Properties p = new Properties();
		URL url = null;
		url = ClassLoader.getSystemClassLoader().getResource("so.properties");

		InputStream in = url.openStream();
		try {
			p.load(in);
		} finally {
			in.close();
		}

		Set<Object> keySet = p.keySet();
		for (Object key : keySet) {
			String keyString = key.toString().trim();
			if (keyString.indexOf("dbQryCache.useCache.nameSpace.") != -1) {
				int index = keyString.indexOf("dbQryCache.useCache.nameSpace.");
				String nameSpace = keyString.substring(index + "dbQryCache.useCache.nameSpace.".length());
				Boolean isUseCache = p.get(key).toString().equalsIgnoreCase("true") ? true : false;
				System.out.println(isUseCache);
			}
		}
	}
}
